<?php 
if(Yii::app()->user->isSuperAdmin()) 
    $this->breadcrumbs=array(
            'Shop Admin'=>array('shop/admin'),
            'My Products',
    );

echo CHtml::link(Shop::t('Create a new Product'), array('products/create'));
//$model = new Products();

$this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'products-grid',
	'dataProvider'=>$model->adminSearch(),
	'filter'=>$model,
	'columns'=>array(
                'title',
		'price',
                array(
                    'class'=>'CLinkColumn',
                    'label'=>Yii::t('ShopModule.shop', 'images'),
                    'urlExpression'=>'"index.php?r=/shop/image/admin&product_id=".$data->product_id',
                    'header'=>'Images'
                    ),

		array(
			'class'=>'CButtonColumn', 
			'template' => '{view}{update}{delete}',
			'viewButtonUrl' => 'Yii::app()->createUrl("/shop/products/view",
                            array("id" => $data->product_id))',
			'updateButtonUrl' => 'Yii::app()->createUrl("/shop/products/update",
                            array("id" => $data->product_id))',
			'deleteButtonUrl' => 'Yii::app()->createUrl("/shop/products/delete",
                            array("id" => $data->product_id))',
		),
	)
)
); 

?>
